package com.winning.sjzc.zyml.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.winning.sjzc.zyml.entity.PsmsSjyxxEntity;
import java.util.List;
import java.util.Map;

import com.winning.sjzc.zyml.entity.vo.SjjywxxEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * description:
 *
 * @author yanxf@winning.com.cn
 * @date 2019/08/14 16:34
 */
@Mapper
public interface PsmsSjyxxMapper extends BaseMapper<PsmsSjyxxEntity> {

  List<PsmsSjyxxEntity> queryPsmsSjyxxList(@Param("sjjdm") String sjjdm);

  IPage<PsmsSjyxxEntity> queryPage(IPage<PsmsSjyxxEntity> page, @Param(Constants.WRAPPER) Wrapper<PsmsSjyxxEntity> queryWrapper);


  @Select("SELECT PSMS_SJJXX.sjjdm,PSMS_SJJXX.sjjmc,PSMS_SJJXX.sjkbm,PSMS_SJJXX.bbh,PSMS_SJJXX.fbrq,SJZC_SJJYWXX.jls,SJZC_SJJYWXX.brl,SJZC_SJJYWXX.gxsj " +
          " FROM PSMS_SJJXX  LEFT JOIN  SJZC_SJJYWXX  on PSMS_SJJXX.SJJDM= SJZC_SJJYWXX.SJJDM WHERE PSMS_SJJXX.SJJFLDM = #{map.sjjfldm}")
  IPage<SjjywxxEntity> sjjywxxPage(IPage<SjjywxxEntity> page, @Param("map") Map map);

  @Select("SELECT * FROM PSMS_SJYXX WHERE SJYDM IN (SELECT SJYDM FROM PSMS_SJYML WHERE SJJDM = #{map.sjkbm})")
  IPage<PsmsSjyxxEntity> sjyxxPage(IPage<PsmsSjyxxEntity> page, @Param("map") Map map);


}
